package na.learn.ejb2;


import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;

public abstract class ConsumerDetailsCMPBean implements EntityBean {

	public abstract void setConsumerId(Integer id);

	public abstract Integer getConsumerId();

	public abstract String getConsumerName();

	public abstract void setConsumerName(String name);

	public abstract Integer getConsumerAge();

	public abstract void setConsumerAge(Integer age);

	public abstract String getConsumerContactNumber();

	public abstract void setConsumerContactNumber(String contactNumber);

	public Integer ejbCreate(Integer id, String name, Integer age, String number)
			throws CreateException {
		System.out.println("ejbCreate : " + name + "," + age + ", " + number);
		setConsumerId(id);
		setConsumerName(name);
		setConsumerAge(age);
		setConsumerContactNumber(number);
		return null;

	}

	public void ejbPostCreate(Integer id, String name, Integer age,
			String number) {
		System.out.println("AccountBean.ejbPostCreate (");
	}

	private EntityContext ctx;

	public void setEntityContext(EntityContext arg0) throws EJBException {
		ctx = arg0;
	}

	public void unsetEntityContext() throws EJBException {
		ctx = null;
	}

	public void ejbRemove() throws RemoveException, EJBException {
	}

	public void ejbActivate() throws EJBException {
	}

	public void ejbPassivate() throws EJBException {
	}

	public void ejbLoad() throws EJBException{
	}

	public void ejbStore() throws EJBException {
	}

}
